package com.qujia.station.utils;

import lombok.Builder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

@Builder
public class YunHuaRefundParam {

//    {
//        "posOrderNo": "TP1564523507906252809Y1",
//            "refundDesc": "接口退款",
//            "partnerCode": "yunhua",
//            "sign": "98d7c6ab58fca3f6a720f0fa98d4f6b7a8a1194e332062880b23ed621c97a41f",
//            "signType": "SHA256",
//            "posDate": "202209021601",
//            "srcPosOrderNo": "TP1564523507906252809",
//            "refundDate": "20220902",
//            "refundAmt": 5
//    }



    String posOrderNo;
    String refundDesc;
    String partnerCode;
    String sign;
    String signType;
    String posDate;
    String srcPosOrderNo;
    String refundDate;
    BigDecimal refundAmt;
    String memberNumber;
    String payNo;

    public String getPosOrderNo() {
        return posOrderNo;
    }

    public void setPosOrderNo(String posOrderNo) {
        this.posOrderNo = posOrderNo;
    }

    public String getRefundDesc() {
        return refundDesc;
    }

    public void setRefundDesc(String refundDesc) {
        this.refundDesc = refundDesc;
    }

    public String getPartnerCode() {
        return partnerCode;
    }

    public void setPartnerCode(String partnerCode) {
        this.partnerCode = partnerCode;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getSignType() {
        return signType;
    }

    public void setSignType(String signType) {
        this.signType = signType;
    }

    public String getPosDate() {
        return posDate;
    }

    public void setPosDate(String posDate) {
        this.posDate = posDate;
    }

    public String getSrcPosOrderNo() {
        return srcPosOrderNo;
    }

    public void setSrcPosOrderNo(String srcPosOrderNo) {
        this.srcPosOrderNo = srcPosOrderNo;
    }

    public String getRefundDate() {
        return refundDate;
    }

    public void setRefundDate(String refundDate) {
        this.refundDate = refundDate;
    }

    public BigDecimal getRefundAmt() {
        return refundAmt;
    }

    public void setRefundAmt(BigDecimal refundAmt) {
        this.refundAmt = refundAmt;
    }

    public String getMemberNumber() {
        return memberNumber;
    }

    public void setMemberNumber(String memberNumber) {
        this.memberNumber = memberNumber;
    }

    public String getPayNo() {
        return payNo;
    }

    public void setPayNo(String payNo) {
        this.payNo = payNo;
    }

    public  String toBeforeSign(){
       String  ff="posOrderNo="+getPosOrderNo()
               +"&refundDesc="+getRefundDesc()
               +"&partnerCode="+getPartnerCode()
               +"&signType="+getSignType()
               +"&posDate="+getPosDate()
               +"&srcPosOrderNo="+getSrcPosOrderNo()
               +"&refundDate="+getRefundDate()
               +"&refundAmt="+getRefundAmt();
        return  ff;
    }
    public  String toRefundAmt(){
        String mm= "{\n" +
                "    \"posOrderNo\": \""+getPosOrderNo()+"\",\n" +
                "    \"refundDesc\": \""+getRefundDesc()+"\",\n" +
                "    \"partnerCode\": \""+getPartnerCode()+"\",\n" +
                "    \"sign\": \""+getSign()+"\",\n" +
                "    \"signType\": \""+getSignType()+"\",\n" +
                "    \"posDate\": \""+getPosDate()+"\",\n" +
                "    \"srcPosOrderNo\": \""+getSrcPosOrderNo()+"\",\n" +
                "    \"refundDate\": \""+getRefundDate()+"\",\n" +
                "    \"refundAmt\": "+getRefundAmt()+"\n" +
                "}";

        return  mm;
    }

    public  String toRefundAmtV2(){
        String mm= "{\n" +
                "    \"fmno\": \""+getPartnerCode()+"\",\n" +
                "    \"clientOrderNo\": \""+getPosOrderNo()+"\",\n" +
                "    \"srcClientSerialNo\": \""+getSrcPosOrderNo()+"\",\n" +
                "    \"srcTransInfoNo\": \""+getMemberNumber()+"\",\n" +
                "    \"srcTransPayNo\": \""+getPayNo()+"\",\n" +
                "    \"refundClientSerialNo\": \""+getPosOrderNo()+"\",\n" +
                "    \"refundDesc\": \""+"退款"+"\"\n"+
                "}";

        return  mm;
    }
    public  String toRefundAmtSingV2(){
        String mm= "{\n" +
                "    \"fmno\": \""+getPartnerCode()+"\",\n" +
                "    \"clientOrderNo\": \""+getPosOrderNo()+"\",\n" +
                "    \"srcClientSerialNo\": \""+getSrcPosOrderNo()+"\",\n" +
                "    \"srcTransInfoNo\": \""+getMemberNumber()+"\",\n" +
                "    \"srcTransPayNo\": \""+getPayNo()+"\",\n" +
                "    \"refundClientSerialNo\": \""+getPosOrderNo()+"\",\n" +
                "    \"refundDesc\": \""+"退款"+"\",\n"+
                "    \"sign\": \""+getSign()+"\"\n"+
                "}";

        return  mm;
    }

    public  String toSelectOrder(){
        String mm= "{\n" +
                "    \"fmno\": \""+getPartnerCode()+"\",\n" +
                "    \"clientOrderNo\": \""+getPosOrderNo()+"\",\n" +
                "    \"clientSerialNo\": \""+getPosOrderNo()+"\"\n" +
                "}";

        return  mm;
    }

    public  String toSelectOrderSign(){
        String mm= "{\n" +
                "    \"fmno\": \""+getPartnerCode()+"\",\n" +
                "    \"clientOrderNo\": \""+getPosOrderNo()+"\",\n" +
                "    \"clientSerialNo\": \""+getPosOrderNo()+"\",\n" +
                "    \"sign\": \""+getSign()+"\",\n" +
                "}";

        return  mm;
    }

}
